//
//  ViewController.m
//  Test
//
//  Created by sdadmin on 2018/5/23.
//  Copyright © 2018年 sdadmin. All rights reserved.
//

#import "ViewController.h"

#import "XPPickerView.h"

#import "NetHelper.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor redColor];
    [self startNetwork];
    // Do any additional setup after loading the view, typically from a nib.
}
#pragma mark 网络缓存 测试
-(void)startNetwork{
    NSString * urlStr = @"http://www.songdongqc.com:8092/json/home/service";
    NSMutableDictionary * dic = [NSMutableDictionary new];
    dic[@"gpsY"] = @"闻气味";
    dic[@"gpsX"] = @"˜";
    dic[@"city"] = @"2312";
    
    [NetHelper requestWithUrlStr:urlStr andParameters:dic completedBlock:^(id response) {
         NSLog(@"请求数据-----%@",response);
    } failuerBlock:^(NSError *error) {
        NSLog(@"失败数据------%@",error.localizedDescription);
    }];
    
//    [PPNetworkHelper POST:urlStr parameters:dic responseCache:^(id responseCache) {
//        if (responseCache) {
//            NSLog(@"有缓冲数据------%@",responseCache);
//        }
//
//    } success:^(id responseObject) {
//        NSLog(@"请求数据-----%@",responseObject);
//    } failure:^(NSError *error) {
//        NSLog(@"失败数据------%@",error.localizedDescription);
//    }];
}




#pragma mark 列表展示测试
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    NSArray *array = @[@"2015年2月8日",@"2015年5月20日",@"2015年8月15日",@"2016年3月2日",@"2017年10月20日"];
    XPPickerView *pickview = [XPPickerView new];
    [pickview.dataArray addObjectsFromArray:array];
    pickview.selectedRow = @"2";
    pickview.back = ^(NSInteger index){
        
        NSLog(@"日期====%ld",index);
    };
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
